Use System.currentTimeMillis() to get the current millisecond. Do not use new Date().getTime(). <br/>
Note: In order to get a more accurate time, use System.nanoTime(). In JDK8, use Instant class to deal with situations like time statistics.
Examples:
<pre>
    public class TimeMillisDemo {
        public static void main(String args[]) {
            // Positive example:
            long a = System.currentTimeMillis();
            // Negative example:
            long b = new Date().getTime();

            System.out.println(a);
            System.out.println(b);
        }
    }
</pre>